package com.eastfair.pay.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.core.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 实体类
 * 发票申请
 * </p>
 *
 * @author clm
 * @since 2022-08-06
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("pay_invoice_applyer_relation")
@ApiModel(value = "InvoiceApplyerRelation", description = "发票申请")
@AllArgsConstructor
public class InvoiceApplyerRelation extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 发票申请id
     */
    @ApiModelProperty(value = "发票申请id")
    @TableField(value = "apply_id")
    @Excel(name = "发票申请id")
    private Long applyId;

    /**
     * 业务id
     */
    @ApiModelProperty(value = "业务id")
    @TableField(value = "business_id")
    @Excel(name = "业务id")
    private Long businessId;

    /**
     * 业务订单号
     */
    @ApiModelProperty(value = "业务订单号")
    @TableField(value = "business_num")
    @Excel(name = "业务订单号")
    private String businessNum;
    /**
     * 开票数量
     */
    @ApiModelProperty(value = "开票数量")
    @TableField(value = "count")
    @Excel(name = "开票数量")
    private Integer count;
    /**
     * 开票单价
     */
    @ApiModelProperty(value = "开票单价")
    @TableField(value = "unit_price")
    @Excel(name = "开票单价")
    private BigDecimal unitPrice;
    /**
     * 开票金额
     */
    @ApiModelProperty(value = "开票金额")
    @TableField(value = "amount")
    @Excel(name = "开票金额")
    private BigDecimal amount;
    /**
     * 税率
     */
    @ApiModelProperty(value = "税率")
    @TableField(value = "tax_rate")
    @Excel(name = "税率")
    private BigDecimal taxRate;
    /**
     * 税额
     */
    @ApiModelProperty(value = "税额")
    @TableField(value = "tax_amount")
    @Excel(name = "税额")
    private BigDecimal taxAmount;
    /**
     * 费用类型
     */
    @ApiModelProperty(value = "费用类型")
    @TableField(value = "cost_type")
    @Excel(name = "费用类型")
    private String costType;

    @Builder
    public InvoiceApplyerRelation(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime,
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId,
                    Long applyId, Long businessId) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.applyId = applyId;
        this.businessId = businessId;
    }

}
